<template>
  <div :style="config.style" class="common-chart-box">
    <component :is="ItemMap[config.name]" />
  </div>
</template>

<script setup lang="ts">
  import { ItemMap } from './charts/index';

  import { PropType, reactive } from 'vue';

  // 获取 props
  const props = defineProps({
    config: {
      type: Object as PropType<any>,
    },
  });

  const { config } = reactive(props);
  console.log('🚀 ~ file: Chart.vue ~ line 20 ~ config', config.style);
</script>

<style scoped>
  .common-chart-box {
    height: 100%;
    width: 100%;
  }
</style>
